package com.galeno.day03.transfer;

import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;

import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/**
 * @author galeno
 * @Title:
 * @Description:
 * @date 2021/10/2214:23
 */
public class BuLong {
    public static void main(String[] args) {
        BloomFilter<String> bloomFilter = BloomFilter.create(Funnels.stringFunnel(StandardCharsets.UTF_8), Integer.MAX_VALUE, 0.0001);
        Scanner scanner=new Scanner(System.in);


        while (true){
            String next = scanner.next();
            if (!bloomFilter.mightContain(next)){
                System.out.println("不存在");
                bloomFilter.put(next);
            }else {
                System.out.println("存在");
            }

        }



    }
}
